import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt

img = cv.imread('/Users/wanggh/Desktop/aa2.png', cv.IMREAD_GRAYSCALE)  # queryImage
img2 = cv.imread('/Users/wanggh/Desktop/original.jpeg', cv.IMREAD_GRAYSCALE)  # trainImage

# 初始化ORB检测器
orb = cv.ORB_create()
# 用ORB寻找关键点
kp = orb.detect(img, None)
# 用ORB计算描述符
kp, des = orb.compute(img, kp)
# 仅绘制关键点的位置，而不绘制大小和方向
img = cv.drawKeypoints(img, kp, None, color=(0, 255, 0), flags=0)
cv.imshow("test", img)
cv.waitKey(0)
cv.destroyAllWindows()
